package com.cwj.film.Listener;

import lombok.Getter;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.ServletContext;

@Component
@Getter
public class Beans implements ApplicationListener<WebServerInitializedEvent> {
    @Resource
    private ServletContext servletContext;
    private String serverPath;
    private String _540x488path;
    private String _1140x1032path;
    private String _1740x1036path;
    @Override
    public void onApplicationEvent(WebServerInitializedEvent web) {
        serverPath=servletContext.getRealPath("");
        _540x488path=servletContext.getRealPath("pict\\_540x488");
        _1140x1032path=servletContext.getRealPath("pict\\_1140x1032");
        _1740x1036path=servletContext.getRealPath("pict\\_1740x1036");

    }
}
